﻿<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/Site.Master" CodeBehind="imageMaintenanceAddComments.aspx.vb" Inherits="Web_2._0_BMW___X6_Experts_Web_Application.imageMaintenanceAddComments" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
    <style type="text/css">


        .style3
        {
            font-size: x-large;
        }
        .style4
        {
            color: #3399FF;
        }
        .mainContent
        {
            height: 1235px;
        }
        .imageMaintenanceIMG
        {
            height: 298px;
            width: 389px;
        }
        .pcomMaintenanceComment
        {
            width: 503px;
            height: 244px;
        }
        .mainArea
        {
            height: 103px;
        }
        .titleArea
        {
            height: 36px;
        }
        .style5
        {
            height: 203px;
            font-size: medium;
        }
        .maintenanceTagArea
        {
            width: 912px;
            height: 6px;
            text-align: right;
        }
    
        .tags
        {
            height: 184px;
        }
        .postTagsInfo
        {
            width: 239px;
        }
        .newTags
        {
            height: 125px;
        }
        .commentTexBox
        {
            height: 394px;
        }
        .newTagsMaintenance100
        {
            height: 26px;
        }
        .style6
        {
            height: 26px;
            font-size: medium;
        }
        .newTagsMaintenance200
        {
            height: 148px;
            width: 492px;
        }
        .currentTagsM
        {
            width: 196px;
            height: 108px;
        }
        .style2
        {
            font-weight: normal;
            font-size: medium;
        }
        .newTagss
        {
            width: 243px;
            height: 139px;
        }
        .addNewTagMAintenance
        {
            height: 130px;
            text-align: left;
        }
        .LikeTools
        {
            width: 361px;
            height: 74px;
            text-align: center;
        }
        .commentTexBoxMaintenance
        {
            height: 138px;
        }
        </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<div class = "imageMaintenanceAddCommentsTitle">



        <span class="st"><span class="style3"><strong>BMW - X6 </strong>
        <span class="style4"><em><strong>Maintenance</strong></em></span><strong> Image 
    Comments</strong></span></span></div>

<div class = "mainContent">
<div class = "Info">

        
        
            So, you like your BMW - X6&#39;s then why not comment on this picture? It doesnt 
            cost you anything...<br />
                <br />
                Simply enter your comment below and press comment. You can also place several 
                tags on the picture by selecting your preffered tags and clicking on tag image. 
                If you cant find a tag which your looking for, enter it in the filed below and 
                click on add new tag. It&#39;s simple as that! 
    <br />
    <br />

</div>

<div class= "pcomMaintenanceComment">

        <asp:FormView ID="FormView1" runat="server" DataSourceID="SqlDataSource2" 
            Height="204px" Width="494px" BorderStyle="Solid" Font-Size="Large" 
            CssClass="pCommentC" >
            <EditItemTemplate>
                <strong>Description:</strong>
                <asp:TextBox ID="ImageDescriptionTextBox" runat="server" 
                    Text='<%# Bind("ImageDescription") %>' />
                <br />
                <strong>Date Uploaded:</strong>
                <asp:TextBox ID="DateUploadedTextBox" runat="server" 
                    Text='<%# Bind("DateUploaded") %>' />
                <br />
                <strong>Time Uploaded:</strong>
                <asp:TextBox ID="TimeUploadedTextBox" runat="server" 
                    Text='<%# Bind("TimeUploaded") %>' />
                <br />
                <strong>Uploaded by:</strong>
                 <a href="UserProfileView.aspx?Username=<%# Eval("UserName") %>"><asp:Label ID="UserNameLabel" runat="server" Text='<%# Eval("UserName") %>' /></a>
                <br />

                <asp:LinkButton ID="UpdateButton" runat="server" CausesValidation="True" 
                    CommandName="Update" Text="Update" />
                &nbsp;<asp:LinkButton ID="UpdateCancelButton" runat="server" 
                    CausesValidation="False" CommandName="Cancel" Text="Cancel" />
            </EditItemTemplate>
            <InsertItemTemplate>
                <strong>Description:</strong>
                <asp:TextBox ID="ImageDescriptionTextBox0" runat="server" 
                    Text='<%# Bind("ImageDescription") %>' />
                <br />
                <strong>Date Uploaded:</strong>
                <asp:TextBox ID="DateUploadedTextBox0" runat="server" 
                    Text='<%# Bind("DateUploaded") %>' />
                <br />
                <strong>Time Uploaded:</strong>
                <asp:TextBox ID="TimeUploadedTextBox0" runat="server" 
                    Text='<%# Bind("TimeUploaded") %>' />
                <br />
                <strong>Uploaded by:</strong>
                 <a href="UserProfileView.aspx?Username=<%# Eval("UserName") %>"><asp:Label ID="UserNameLabel" runat="server" Text='<%# Eval("UserName") %>' /></a>
                <br />

                <asp:LinkButton ID="InsertButton" runat="server" CausesValidation="True" 
                    CommandName="Insert" Text="Insert" />
                &nbsp;<asp:LinkButton ID="InsertCancelButton" runat="server" 
                    CausesValidation="False" CommandName="Cancel" Text="Cancel" />
            </InsertItemTemplate>
            <ItemTemplate>
                <strong> Description:</strong>
                <asp:Label ID="ImageDescriptionLabel" runat="server" 
                    Text='<%# Bind("ImageDescription") %>' />
                <br />
                <br />
                <strong>Date Uploaded:</strong>
                <asp:Label ID="DateUploadedLabel" runat="server" 
                    Text='<%# Bind("DateUploaded") %>' />
                <br />
                <br />
                <strong>Time Uploaded:</strong>
                <asp:Label ID="TimeUploadedLabel" runat="server" 
                    Text='<%# Bind("TimeUploaded") %>' />
                <br />
                <br />
                <strong>Uploaded by:</strong>
                 <a href="UserProfileView.aspx?Username=<%# Eval("UserName") %>"><asp:Label ID="UserNameLabel" runat="server" Text='<%# Eval("UserName") %>' /></a>
                <br />


            </ItemTemplate>
        </asp:FormView>

        <asp:SqlDataSource ID="SqlDataSource2" runat="server" 
            ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
            ProviderName="<%$ ConnectionStrings:ConnectionString.ProviderName %>" 
            SelectCommand="SELECT Maintenance_Images.MaintenanceImageID, Maintenance_Images.ImageDescription, Maintenance_Images.DateUploaded, Maintenance_Images.TimeUploaded, aspnet_Users.UserName FROM (aspnet_Users INNER JOIN Maintenance_Images ON aspnet_Users.UserId = Maintenance_Images.UserIDFK) WHERE (Maintenance_Images.MaintenanceImageID = ?)">
            <SelectParameters>
                <asp:QueryStringParameter Name="?" QueryStringField="id" />
            </SelectParameters>
        </asp:SqlDataSource>

</div>

<div class = "imageMaintenanceIMG">
<div class = "areaTitle">

</div>

    <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
        DataKeyNames="MaintenanceImageID" DataSourceID="SqlDataSource1" Height="178px" 
        Width="342px">
        <Columns>
            <asp:ImageField DataAlternateTextField="ImageLink" 
                DataImageUrlField="ImageLink" HeaderText="***Image Comments***">
                <ControlStyle CssClass="imageCommentsImage" />
                <ItemStyle CssClass="imageCommentsImage" />
            </asp:ImageField>
        </Columns>
    </asp:GridView>
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
        ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
        ProviderName="<%$ ConnectionStrings:ConnectionString.ProviderName %>" 
        SelectCommand="SELECT [MaintenanceImageID], [ImageLink] FROM [Maintenance_Images] WHERE ([MaintenanceImageID] = ?)">
        <SelectParameters>
            <asp:QueryStringParameter Name="MaintenanceImageID" QueryStringField="id" 
                Type="Int32" />
        </SelectParameters>
    </asp:SqlDataSource>



</div>

<div class = "mainArea">


<div class = "style5">


    <strong><em>
    <div class = "LikeTools">
    
                <asp:Image ID="imgLike" runat="server" Height="35px" 
                    ImageUrl="~/Pictures/imgLiked.jpg" style="text-align: center" 
                    Width="55px" />
                <asp:Label ID="lblTotalCounts" runat="server" Text="Label" Font-Size="Medium" 
                    BorderStyle="Inset" Width="57px"></asp:Label>
            <br />
            
            
            
                <asp:Button ID="btnLike" runat="server" Height="28px" 
                    style="text-align: left" Text="Like This Image" Width="133px" 
                    Font-Bold="True" Font-Italic="True" />
            
            
                
    </div>
    User Comments for this Image&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </em></strong></div>
</div>

<div class = "maintenanceTags100">

            <div class = "addNewImageContent100">
        
        
        
    <div class = "text20" 
        style="font-size: medium; font-style: italic; font-weight: bold">

        &nbsp;&nbsp;

                               Comment this photo...<div class = "text200" 
            
            
            
            
            
            
            
            
            style="font-weight: normal; font-style: normal; font-size: small; height: 483px; width: 502px;"> 
            To add a comment to this image, simply enter your comment below and click 
            comment.<div class = "commentTexBoxMaintenance"> 
                <asp:TextBox ID="txtimagecomment" runat="server" BorderStyle="Solid" Height="77px" 
                    Width="456px" TextMode="MultiLine"></asp:TextBox>
                <br />
                <asp:Button ID="btncomment" runat="server" Text="Comment" Width="132px" />
                <br />
        <span class="st">
                <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" 
                    ControlToValidate="txtimagecomment" 
                    ErrorMessage="The comment box is empty, please enter the comment and press comment." 
                    Font-Bold="True" Font-Italic="True" ForeColor="Red"></asp:RequiredFieldValidator>
        
        </span>
                <br />

            </div><div class = "style6">
                
                <strong><em>Tag the Photo&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Current Tags</em></strong></div>
                <div class = "currentTagsMaintenance200">
                
                
                <div class = "newTagsMaintenance200">
                <div class = "newTagss">
                <div class = "InfoM">
                
                            <span class="style2">Below are the tags currently tagged on the image shown 
                            above</span>.
                        
                        </div>
                        <div class = "lBX">
                        
                        
                        
                            <asp:ListBox ID="ListBox1" runat="server" DataSourceID="SqlDataSource5" 
                                DataTextField="TagName" DataValueField="TagName" Height="101px" 
                                Width="245px" SelectionMode="Multiple" Font-Names="Calibri" 
                                Font-Size="Medium">
                            </asp:ListBox>
                            <asp:SqlDataSource ID="SqlDataSource5" runat="server" 
                                ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
                                ProviderName="<%$ ConnectionStrings:ConnectionString.ProviderName %>" 
                                SelectCommand="SELECT Maintenance_Image_Tags.MaintenanceImageIDFK, Tags.TagName FROM (Maintenance_Image_Tags INNER JOIN Tags ON Maintenance_Image_Tags.TagIDFK = Tags.TagID) WHERE (Maintenance_Image_Tags.MaintenanceImageIDFK = ?)">
                                <SelectParameters>
                                    <asp:QueryStringParameter Name="?" QueryStringField="id" />
                                </SelectParameters>
                            </asp:SqlDataSource>
                        
                        </div>
                </div>
                    <asp:Panel ID="Panel1" runat="server" Height="118px" Width="219px" 
                        ScrollBars="Horizontal">
                       
                            <asp:CheckBoxList ID="cbxtagsMaintenance" runat="server" 
                                DataSourceID="SqlDataSource4" DataTextField="TagName" 
                                DataValueField="TagID" RepeatLayout="Flow" style="font-family: Calibri">
                            </asp:CheckBoxList>
                        
                        <asp:SqlDataSource ID="SqlDataSource4" runat="server" 
                            ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
                            ProviderName="<%$ ConnectionStrings:ConnectionString.ProviderName %>" 
                            SelectCommand="SELECT [TagID], [TagName] FROM [Tags]"></asp:SqlDataSource>
                        <br />
                    </asp:Panel>
                <div class = "tagButton">
                

                        <asp:Button ID="btntagimage" runat="server" Height="28px" Text="Tag Image" 
                                Width="144px" />
                
                </div>
                </div>
                </div>
                <div class = "addNewTagMAintenance">
                
                    <br />
                        To create a new tag, simply enter your tag name and click on Add.<br />
                    <br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                        <asp:TextBox ID="txtnewtag" runat="server" Width="252px" 
                        style="text-align: left; font-family: Calibri;"></asp:TextBox>
                        <br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                        <asp:Button ID="btnaddnewtag" runat="server" Height="28px" Text="Add New Tag" 
                            Width="144px" />
                
                    <br />
        <span class="st">
                <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" 
                    ControlToValidate="txtnewtag" 
                    ErrorMessage="Sorry, you have not entered a tag, please check and try again. " 
                    Font-Bold="True" Font-Italic="True" ForeColor="Red"></asp:RequiredFieldValidator>
        
        </span>
                
                </div>
                </div>
                
                
                </div> 

        
        
        </div>

</div>

<div class = "List1">


    <asp:ListView ID="ListView1" runat="server" DataSourceID="SqlDataSource3">
        <AlternatingItemTemplate>
            
            <strong>Comment:</strong>
            <asp:Label ID="CommentBodyLabel" runat="server" 
                Text='<%# Eval("CommentBody") %>' />
            <br />
            <strong>Date Uploaded:</strong>
            <asp:Label ID="DateUploadedLabel" runat="server" 
                Text='<%# Eval("DateUploaded") %>' />
            <br />
            <strong>Time Uploaded:</strong>
            <asp:Label ID="TimeUploadedLabel" runat="server" 
                Text='<%# Eval("TimeUploaded") %>' />
            <br />
            <strong>Comment Posted by:</strong>
             <a href="UserProfileView.aspx?Username=<%# Eval("UserName") %>"><asp:Label ID="UserNameLabel" runat="server" Text='<%# Eval("UserName") %>' /></a>
            <br />
<br /></span>
        </AlternatingItemTemplate>
        <EditItemTemplate>
            <span style="">ImageCommentID:
            <asp:Label ID="ImageCommentIDLabel1" runat="server" 
                Text='<%# Eval("ImageCommentID") %>' />
            <br />
            <strong>Comment:</strong>
            <asp:TextBox ID="CommentBodyTextBox" runat="server" 
                Text='<%# Bind("CommentBody") %>' />
            <br />
            <strong>Date Uploaded:</strong>
            <asp:TextBox ID="DateUploadedTextBox" runat="server" 
                Text='<%# Bind("DateUploaded") %>' />
            <br />
            <strong>Time Uploaded:</strong>
            <asp:TextBox ID="TimeUploadedTextBox" runat="server" 
                Text='<%# Bind("TimeUploaded") %>' />
            <br />
            <strong>Comment Posted by:</strong>
             <a href="UserProfileView.aspx?Username=<%# Eval("UserName") %>"><asp:Label ID="UserNameLabel" runat="server" Text='<%# Eval("UserName") %>' /></a>
            <br />
            <asp:Button ID="UpdateButton" runat="server" CommandName="Update" 
                Text="Update" />
            <asp:Button ID="CancelButton" runat="server" CommandName="Cancel" 
                Text="Cancel" />
            <br /><br /></span>
        </EditItemTemplate>
        <EmptyDataTemplate>
            <span>No data was returned.</span>
        </EmptyDataTemplate>
        <InsertItemTemplate>
            <span style=""><strong>Comment:</strong>
            <asp:TextBox ID="CommentBodyTextBox" runat="server" 
                Text='<%# Bind("CommentBody") %>' />
            <br /><strong>Date Uploaded:</strong>
            <asp:TextBox ID="DateUploadedTextBox" runat="server" 
                Text='<%# Bind("DateUploaded") %>' />
            <br /><strong>Time Uploaded:</strong>
            <asp:TextBox ID="TimeUploadedTextBox" runat="server" 
                Text='<%# Bind("TimeUploaded") %>' />
            <br /><strong>Comment Posted by:</strong>
            <a href="UserProfileView.aspx?Username=<%# Eval("UserName") %>"><asp:Label ID="UserNameLabel" runat="server" Text='<%# Eval("UserName") %>' /></a>
            <br />
            <asp:Button ID="InsertButton" runat="server" CommandName="Insert" 
                Text="Insert" />
            <asp:Button ID="CancelButton" runat="server" CommandName="Cancel" 
                Text="Clear" />
            <br /><br /></span>
        </InsertItemTemplate>
        <ItemTemplate>
            
            <strong>Comment:</strong>
            <asp:Label ID="CommentBodyLabel" runat="server" 
                Text='<%# Eval("CommentBody") %>' />
            <br />
            <strong>Date Uploaded:</strong>
            <asp:Label ID="DateUploadedLabel" runat="server" 
                Text='<%# Eval("DateUploaded") %>' />
            <br />
            <strong>Time Uploaded:</strong>
            <asp:Label ID="TimeUploadedLabel" runat="server" 
                Text='<%# Eval("TimeUploaded") %>' />
            <br />
            <strong>Comment Posted by:</strong>
             <a href="UserProfileView.aspx?Username=<%# Eval("UserName") %>"><asp:Label ID="UserNameLabel" runat="server" Text='<%# Eval("UserName") %>' /></a>
            <br />
<br /></span>
        </ItemTemplate>
        <LayoutTemplate>
            <div ID="itemPlaceholderContainer" runat="server" style="">
                <span runat="server" id="itemPlaceholder" />
            </div>
            <div>
                 <asp:DataPager ID="DataPager1" runat="server" PagedControlID="ListView1" PageSize="8">
                            
                                <Fields>
                                    <asp:NextPreviousPagerField ButtonType="Button" ShowFirstPageButton="True" 
                                        ShowNextPageButton="False" ShowPreviousPageButton="False" />
                                    <asp:NumericPagerField />
                                    <asp:NextPreviousPagerField ButtonType="Button" ShowLastPageButton="True" 
                                        ShowNextPageButton="False" ShowPreviousPageButton="False" />
                                </Fields>
                            </asp:DataPager>
            </div>
        </LayoutTemplate>
        <SelectedItemTemplate>
            
            <strong>Comment:</strong>
            <asp:Label ID="CommentBodyLabel" runat="server" 
                Text='<%# Eval("CommentBody") %>' />
            <br />
            <strong>Date Uploaded:</strong>
            <asp:Label ID="DateUploadedLabel" runat="server" 
                Text='<%# Eval("DateUploaded") %>' />
            <br />
            <strong>Time Uploaded:</strong>
            <asp:Label ID="TimeUploadedLabel" runat="server" 
                Text='<%# Eval("TimeUploaded") %>' />
            <br />
            <strong>Comment Posted by:</strong>
             <a href="UserProfileView.aspx?Username=<%# Eval("UserName") %>"><asp:Label ID="UserNameLabel" runat="server" Text='<%# Eval("UserName") %>' /></a>
            <br />
<br /></span>
        </SelectedItemTemplate>
    </asp:ListView>
    <asp:SqlDataSource ID="SqlDataSource3" runat="server" 
        ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
        ProviderName="<%$ ConnectionStrings:ConnectionString.ProviderName %>" 
        
        SelectCommand="SELECT Maintenance_Image_Comments.CommentBody, Maintenance_Image_Comments.DateUploaded, Maintenance_Image_Comments.TimeUploaded, aspnet_Users.UserName, Maintenance_Image_Comments.ImageID, Maintenance_Image_Comments.ImageCommentID FROM (Maintenance_Image_Comments INNER JOIN aspnet_Users ON Maintenance_Image_Comments.UserID = aspnet_Users.UserId) WHERE (Maintenance_Image_Comments.ImageID = ?) ORDER BY Maintenance_Image_Comments.ImageCommentID DESC">
        <SelectParameters>
            <asp:QueryStringParameter DefaultValue="" Name="?" QueryStringField="id" />
        </SelectParameters>
    </asp:SqlDataSource>


</div>    


</div>

</asp:Content>
